package com.e3.web.widget.client;

import com.extjs.gxt.ui.client.util.IconHelper;
import com.extjs.gxt.ui.client.widget.button.Button;

public class MyButton extends Button {
	
	private BaseAction action;

	public MyButton(BaseAction action) {
		super();
		this.action = action;
		setText(action.getText());
		if(action.getIcon()!=null&&action.getIcon().trim().length()>0){
			setIcon(IconHelper.create(action.getIcon()));
		}
		action.addComponent(this);
	}

	public BaseAction getAction() {
		return action;
	}

	public void setAction(BaseAction action) {
		this.action = action;
	}
}
